using SM.core;
using SS;
using System;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Windows.Forms;
using TVSBH.core;
namespace TVSBH.func
{
	public class frmSurplus : Form
	{
		private Func objFunc = new Func();
		private DataTable objTable = new DataTable();
		private DataTable objTableBill = new DataTable();
		private Bill objBill = new Bill();
		private Partner objPartner = new Partner();
		public string userName = "";
		public string fullName = "";
		private string currPid = "";
		private string providerAddress = "";
		private bool noAllowOtherEditBill = false;
		private IContainer components = null;
		private GroupBox groupBox1;
		private TextBox txtID;
		private Label label1;
		private DateTimePicker txtDate;
		private Label label2;
		private Label label3;
		private Label label4;
		private ComboBox cbbWareHouse;
		private ComboBox cbbTypeInput;
		private ComboBox cbbProvider;
		private Label label5;
		private Label label6;
		private TextBox txtDebt;
		private TextBox txtTotalMoney;
		private TextBox txtNote;
		private Label label8;
		private DataGridView dgvProduct;
		private GroupBox groupBox2;
		private TextBox txtProductName;
		private Label label9;
		private TextBox txtProductUnit;
		private Label label10;
		private TextBox txtProductMoney;
		private Label label12;
		private TextBox txtProductNumber;
		private Label label11;
		private TextBox txtProductPrice;
		private Label label13;
		private TextBox txtProductPacket;
		private Label label14;
		private Label label15;
		private DateTimePicker dptProductExpiryDate;
		private Label label16;
		private DateTimePicker dtpProductDate;
		private Button btnClose;
		private DataGridView dgvBill;
		private DateTimePicker dtpSelectMonth;
		private TextBox txtProductPrice2;
		private Label label19;
		private TextBox txtProductPrice1;
		private Label label18;
		private Label label20;
		private ComboBox cbbVAT;
		private Label label21;
		private ComboBox cbbNational;
		private GroupBox groupBox4;
		private CheckBox cbbAllProduct;
		private CheckBox cbbAllGroup;
		private ComboBox cbbProduct;
		private Label label22;
		private ComboBox cbbParentGID;
		private Label label23;
		private DataGridViewTextBoxColumn Column1;
		private DataGridViewTextBoxColumn Column2;
		private DataGridViewTextBoxColumn Column3;
		private DataGridViewTextBoxColumn Column4;
		private DataGridViewTextBoxColumn Column5;
		private DataGridViewTextBoxColumn Column6;
		private DataGridViewTextBoxColumn Column18;
		private DataGridViewTextBoxColumn Column7;
		private DataGridViewTextBoxColumn Column8;
		private DataGridViewTextBoxColumn Column9;
		private DataGridViewTextBoxColumn Column15;
		private DataGridViewTextBoxColumn Column16;
		private DataGridViewTextBoxColumn Column17;
		private DataGridViewTextBoxColumn Column22;
		private DateTimePicker dtpInDay;
		private RadioButton rdbInDay;
		private RadioButton rdbInMonth;
		private Button btnSearch;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn7;
		private DataGridViewTextBoxColumn Column10;
		private DataGridViewTextBoxColumn Column11;
		private DataGridViewTextBoxColumn Column12;
		private DataGridViewTextBoxColumn Column13;
		private DataGridViewTextBoxColumn Column14;
		private DataGridViewTextBoxColumn Column19;
		private DataGridViewTextBoxColumn Column20;
		private DataGridViewTextBoxColumn Column21;
		private DataGridViewTextBoxColumn Column23;
		public frmSurplus()
		{
			this.InitializeComponent();
		}
		private void frmInput_Load(object sender, EventArgs e)
		{
			this.objFunc.LoadComboBox("SELECT * FROM [TabTypeInput] ORDER BY [OrderBy]", this.cbbTypeInput, "ID", "Name");
			this.objFunc.LoadComboBox("SELECT * FROM [TabWareHouse] ORDER BY [WareHouse_ID]", this.cbbWareHouse, "WareHouse_ID", "WareHouse_Name");
			this.objFunc.LoadComboBox("SELECT CusID, UPPER(Name) AS Name FROM [TabPartner] WHERE [IsProvider] = 1 ORDER BY Name", this.cbbProvider, "CusID", "Name");
			this.objFunc.LoadComboBox("SELECT * FROM [TabNational] ORDER BY [Name]", this.cbbNational, "ID", "Name");
			this.objFunc.LoadComboBox("SELECT GpID, UPPER(GpName) AS GpName FROM TabGproducts ORDER BY GpName", this.cbbParentGID, "GpID", "GpName");
			this.cbbVAT.SelectedIndex = 0;
			this.getBill("");
		}
		private void btnClose_Click(object sender, EventArgs e)
		{
			base.Close();
		}
		private void frmInput_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Escape)
			{
				base.Close();
			}
		}
		private void txtProductNumber_TextChanged(object sender, EventArgs e)
		{
			double num = 0.0;
			if (this.txtProductNumber.Text != "")
			{
				float num2 = 0f;
				if (this.cbbVAT.SelectedIndex == 0)
				{
					num2 = 0f;
				}
				else
				{
					if (this.cbbVAT.SelectedIndex == 1)
					{
						num2 = 5f;
					}
					else
					{
						if (this.cbbVAT.SelectedIndex == 2)
						{
							num2 = 10f;
						}
					}
				}
				try
				{
					num = double.Parse(this.txtProductNumber.Text);
				}
				catch
				{
					num = 0.0;
				}
				if (this.txtProductPrice.Text != "")
				{
					this.txtProductMoney.Text = (num * double.Parse(this.txtProductPrice.Text) * (double)(1f + num2 / 100f)).ToString();
				}
			}
		}
		private void txtProductName_TextChanged(object sender, EventArgs e)
		{
		}
		private int checkInObjTable(string Pid, string Packet)
		{
			int num = -1;
			int result;
			for (int i = 0; i < this.objTable.Rows.Count; i++)
			{
				if (this.objTable.Rows[i]["Pid"].ToString() == Pid && this.objTable.Rows[i]["Packet"].ToString() == Packet)
				{
					num = i;
					result = num;
					return result;
				}
			}
			result = num;
			return result;
		}
		private void resetControl()
		{
			this.txtProductNumber.Text = "";
			this.txtProductName.Text = "";
			this.txtProductPacket.Text = "";
			this.txtProductUnit.Text = "";
			this.txtProductPrice.Text = "";
			this.txtProductMoney.Text = "";
			this.txtProductPrice1.Text = "";
			this.txtProductPrice2.Text = "";
			this.currPid = "";
		}
		private double checkMoneyOfBill()
		{
			double num = 0.0;
			for (int i = 0; i < this.objTable.Rows.Count; i++)
			{
				num += double.Parse(this.objTable.Rows[i]["ProductMoney"].ToString());
			}
			return num;
		}
		private void updateObjTable(int index)
		{
			this.objTable.Rows[index]["Pid"] = this.currPid;
			this.objTable.Rows[index]["ProductName"] = this.txtProductName.Text;
			this.objTable.Rows[index]["ProductUnit"] = this.txtProductUnit.Text;
			this.objTable.Rows[index]["ProductPrice"] = this.txtProductPrice.Text;
			this.objTable.Rows[index]["ProductNumber"] = this.txtProductNumber.Text;
			this.objTable.Rows[index]["ProductMoney"] = this.txtProductMoney.Text;
			this.objTable.Rows[index]["Packet"] = this.txtProductPacket.Text;
			this.objTable.Rows[index]["ProductDate"] = this.dtpProductDate.Text;
			this.objTable.Rows[index]["ProductExpiryDate"] = this.dptProductExpiryDate.Text;
			this.objTable.Rows[index]["ProductPrice1"] = this.txtProductPrice1.Text;
			this.objTable.Rows[index]["ProductPrice2"] = this.txtProductPrice2.Text;
			this.objTable.Rows[index]["NationalID"] = this.cbbNational.SelectedValue.ToString();
			float num = 0f;
			if (this.cbbVAT.SelectedIndex == 0)
			{
				num = 0f;
			}
			else
			{
				if (this.cbbVAT.SelectedIndex == 1)
				{
					num = 5f;
				}
				else
				{
					if (this.cbbVAT.SelectedIndex == 2)
					{
						num = 10f;
					}
				}
			}
			this.objTable.Rows[index]["VAT"] = num;
		}
		private void dgvProduct_CellEnter(object sender, DataGridViewCellEventArgs e)
		{
			try
			{
				if (e.RowIndex != -1)
				{
					this.currPid = this.objTable.Rows[e.RowIndex]["Pid"].ToString();
					this.txtProductName.Text = this.objTable.Rows[e.RowIndex]["ProductName"].ToString();
					this.txtProductUnit.Text = this.objTable.Rows[e.RowIndex]["ProductUnit"].ToString();
					this.txtProductPrice.Text = this.objTable.Rows[e.RowIndex]["ProductPrice"].ToString();
					this.txtProductNumber.Text = this.objTable.Rows[e.RowIndex]["ProductNumber"].ToString();
					this.txtProductMoney.Text = this.objTable.Rows[e.RowIndex]["ProductMoney"].ToString();
					this.txtProductPacket.Text = this.objTable.Rows[e.RowIndex]["Packet"].ToString();
					this.dtpProductDate.Value = DateTime.Parse(this.dgvProduct.Rows[e.RowIndex].Cells["Column7"].Value.ToString());
					this.dptProductExpiryDate.Value = DateTime.Parse(this.dgvProduct.Rows[e.RowIndex].Cells["Column8"].Value.ToString());
					this.txtProductPrice1.Text = this.objTable.Rows[e.RowIndex]["ProductPrice1"].ToString();
					this.txtProductPrice2.Text = this.objTable.Rows[e.RowIndex]["ProductPrice2"].ToString();
					this.cbbNational.SelectedValue = this.objTable.Rows[e.RowIndex]["NationalID"].ToString();
					if (this.objTable.Rows[e.RowIndex]["VAT"].ToString() == "0")
					{
						this.cbbVAT.SelectedIndex = 0;
					}
					else
					{
						if (this.objTable.Rows[e.RowIndex]["VAT"].ToString() == "5")
						{
							this.cbbVAT.SelectedIndex = 1;
						}
						else
						{
							if (this.objTable.Rows[e.RowIndex]["VAT"].ToString() == "10")
							{
								this.cbbVAT.SelectedIndex = 2;
							}
						}
					}
				}
			}
			catch
			{
			}
		}
		private void txtProductNumber_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.txtProductPacket.Focus();
			}
		}
		private void getBill(string sql_Search)
		{
			this.dgvBill.AutoGenerateColumns = false;
			this.dgvProduct.AutoGenerateColumns = false;
			this.dgvProduct.DataSource = null;
			SqlConnection sqlConnection = new SqlConnection(this.objFunc.strConnectionString);
			string cmdText;
			if (sql_Search == "")
			{
				if (this.rdbInDay.Checked)
				{
					cmdText = string.Concat(new object[]
					{
						"SELECT DISTINCT [TabBill].[ID],  [TabBill].[CreateDate], [TabBill].[Surplus] FROM [TabBill] WHERE [TypeInput] IN ('OUT1','OUT2','OUT3','OUT4') AND datepart(Day,CreateDate) = ",
						this.dtpInDay.Value.Day.ToString(),
						" AND datepart(Month,CreateDate) = ",
						this.dtpInDay.Value.Month,
						" AND datepart(Year,CreateDate) = ",
						this.dtpInDay.Value.Year,
						" ORDER BY [CreateDate] DESC"
					});
				}
				else
				{
					cmdText = string.Concat(new object[]
					{
						"SELECT DISTINCT [TabBill].[ID],  [TabBill].[CreateDate], [TabBill].[Surplus] FROM [TabBill] WHERE [TypeInput] IN ('OUT1','OUT2','OUT3','OUT4') AND datepart(Month,CreateDate) = ",
						this.dtpSelectMonth.Value.Month,
						" AND datepart(Year,CreateDate) = ",
						this.dtpSelectMonth.Value.Year,
						" ORDER BY [CreateDate] DESC"
					});
				}
			}
			else
			{
				cmdText = sql_Search;
			}
			SqlCommand selectCommand = new SqlCommand(cmdText, sqlConnection);
			SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(selectCommand);
			DataSet dataSet = new DataSet();
			sqlConnection.Open();
			sqlDataAdapter.Fill(dataSet);
			this.objTableBill = dataSet.Tables[0];
			this.dgvBill.DataSource = this.objTableBill;
			sqlConnection.Close();
			sqlConnection.Dispose();
			sqlDataAdapter.Dispose();
			dataSet.Dispose();
			double num = 0.0;
			for (int i = 0; i < this.dgvBill.Rows.Count; i++)
			{
				try
				{
					num += double.Parse(this.dgvBill.Rows[i].Cells["Column23"].Value.ToString());
				}
				catch
				{
					num += 0.0;
				}
			}
			this.txtTotalMoney.Text = string.Format(Program.lenAffterDecimal, num);
		}
		private void dgvBill_CellEnter(object sender, DataGridViewCellEventArgs e)
		{
			this.txtID.Text = this.objTableBill.Rows[e.RowIndex]["ID"].ToString();
			this.objTable = new DataTable();
			this.objTable = this.objBill.getDetailBillSurplus(this.txtID.Text);
			this.dgvProduct.DataSource = this.objTable;
			this.dgvProduct.Refresh();
			this.txtID.ReadOnly = true;
			this.txtProductNumber.ReadOnly = true;
			this.txtProductPacket.ReadOnly = true;
			this.txtProductPrice.ReadOnly = true;
			this.txtProductPrice1.ReadOnly = true;
			this.txtProductPrice2.ReadOnly = true;
			this.resetControl();
		}
		private void cbbProvider_SelectedIndexChanged(object sender, EventArgs e)
		{
		}
		private void dtpSelectMonth_ValueChanged(object sender, EventArgs e)
		{
		}
		private void dgvProduct_KeyPress(object sender, KeyPressEventArgs e)
		{
			MessageBox.Show(e.KeyChar.ToString());
		}
		private void txtProductUnit_TextChanged(object sender, EventArgs e)
		{
		}
		private void txtProductPrice_TextChanged(object sender, EventArgs e)
		{
		}
		private void txtProductMoney_TextChanged(object sender, EventArgs e)
		{
		}
		private void cbbVAT_SelectedIndexChanged(object sender, EventArgs e)
		{
			double num = 0.0;
			if (this.txtProductNumber.Text != "")
			{
				float num2 = 0f;
				if (this.cbbVAT.SelectedIndex == 0)
				{
					num2 = 0f;
				}
				else
				{
					if (this.cbbVAT.SelectedIndex == 1)
					{
						num2 = 5f;
					}
					else
					{
						if (this.cbbVAT.SelectedIndex == 2)
						{
							num2 = 10f;
						}
					}
				}
				try
				{
					num = double.Parse(this.txtProductNumber.Text);
				}
				catch
				{
					num = 0.0;
				}
				if (this.txtProductPrice.Text != "")
				{
					this.txtProductMoney.Text = (num * double.Parse(this.txtProductPrice.Text) * (double)(1f + num2 / 100f)).ToString();
				}
			}
		}
		private void cbbParentGID_SelectedIndexChanged(object sender, EventArgs e)
		{
			this.objFunc.LoadComboBox("SELECT PID, UPPER(P_Name) AS P_Name FROM [TabProducts] WHERE [GpID] = " + this.cbbParentGID.SelectedValue.ToString() + " ORDER BY P_Name", this.cbbProduct, "PID", "P_Name");
		}
		private void cbbProduct_SelectedIndexChanged(object sender, EventArgs e)
		{
		}
		private void cbbAllProduct_CheckedChanged(object sender, EventArgs e)
		{
			if (this.cbbAllProduct.Checked)
			{
				string sql_Search = string.Concat(new object[]
				{
					"SELECT DISTINCT [TabBill].[ID],  [TabBill].[CreateDate], [TabBill].[Surplus] FROM [TabBill],[TabDetailBill] WHERE [TabDetailBill].[billID] = [TabBill].[ID] AND [TypeInput] IN ('OUT1','OUT2','OUT3','OUT4') AND datepart(Month,[TabBill].[CreateDate]) = ",
					this.dtpSelectMonth.Value.Month,
					" AND datepart(Year,[TabBill].[CreateDate]) = ",
					this.dtpSelectMonth.Value.Year,
					" AND [TabDetailBill].[PID] IN (SELECT PID FROM [TabProducts] WHERE [GpID] = ",
					this.cbbParentGID.SelectedValue.ToString(),
					") ORDER BY [TabBill].[CreateDate] DESC"
				});
				this.getBill(sql_Search);
			}
			else
			{
				this.btnSearch.PerformClick();
			}
		}
		private void cbbAllGroup_CheckedChanged(object sender, EventArgs e)
		{
			this.getBill("");
		}
		private void btnSearch_Click(object sender, EventArgs e)
		{
			if (!this.cbbAllGroup.Checked && !this.cbbAllProduct.Checked)
			{
				string sql_Search;
				if (this.rdbInDay.Checked)
				{
					sql_Search = string.Concat(new object[]
					{
						"SELECT DISTINCT [TabBill].[ID], [TabBill].[CreateDate], [TabBill].[Surplus] FROM [TabBill],TabDetailBill WHERE [TabDetailBill].[billID] = [TabBill].[ID] AND [TypeInput] IN ('OUT1','OUT2','OUT3','OUT4') AND datepart(Day,[TabBill].[CreateDate]) = ",
						this.dtpInDay.Value.Day,
						" AND datepart(Month,[TabBill].[CreateDate]) = ",
						this.dtpInDay.Value.Month,
						" AND datepart(Year,[TabBill].[CreateDate]) = ",
						this.dtpInDay.Value.Year,
						" AND [TabDetailBill].[PID] = ",
						this.cbbProduct.SelectedValue.ToString(),
						" ORDER BY [TabBill].[CreateDate] DESC"
					});
				}
				else
				{
					sql_Search = string.Concat(new object[]
					{
						"SELECT DISTINCT [TabBill].[ID], [TabBill].[CreateDate], [TabBill].[Surplus] FROM [TabBill],TabDetailBill WHERE [TabDetailBill].[billID] = [TabBill].[ID] AND [TypeInput] IN ('OUT1','OUT2','OUT3','OUT4') AND datepart(Month,[TabBill].[CreateDate]) = ",
						this.dtpSelectMonth.Value.Month,
						" AND datepart(Year,[TabBill].[CreateDate]) = ",
						this.dtpSelectMonth.Value.Year,
						" AND [TabDetailBill].[PID] = ",
						this.cbbProduct.SelectedValue.ToString(),
						" ORDER BY [TabBill].[CreateDate] DESC"
					});
				}
				this.getBill(sql_Search);
			}
			else
			{
				this.getBill("");
			}
		}
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.components != null)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}
		private void InitializeComponent()
		{
			DataGridViewCellStyle dataGridViewCellStyle = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle2 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle3 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle4 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle5 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle6 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle7 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle8 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle9 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle10 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle11 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle12 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle13 = new DataGridViewCellStyle();
			ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(frmSurplus));
			this.groupBox1 = new GroupBox();
			this.txtNote = new TextBox();
			this.label8 = new Label();
			this.txtDebt = new TextBox();
			this.label6 = new Label();
			this.cbbProvider = new ComboBox();
			this.label5 = new Label();
			this.cbbWareHouse = new ComboBox();
			this.cbbTypeInput = new ComboBox();
			this.label3 = new Label();
			this.label4 = new Label();
			this.label2 = new Label();
			this.txtDate = new DateTimePicker();
			this.txtID = new TextBox();
			this.label1 = new Label();
			this.txtTotalMoney = new TextBox();
			this.dgvProduct = new DataGridView();
			this.Column1 = new DataGridViewTextBoxColumn();
			this.Column2 = new DataGridViewTextBoxColumn();
			this.Column3 = new DataGridViewTextBoxColumn();
			this.Column4 = new DataGridViewTextBoxColumn();
			this.Column5 = new DataGridViewTextBoxColumn();
			this.Column6 = new DataGridViewTextBoxColumn();
			this.Column18 = new DataGridViewTextBoxColumn();
			this.Column7 = new DataGridViewTextBoxColumn();
			this.Column8 = new DataGridViewTextBoxColumn();
			this.Column9 = new DataGridViewTextBoxColumn();
			this.Column15 = new DataGridViewTextBoxColumn();
			this.Column16 = new DataGridViewTextBoxColumn();
			this.Column17 = new DataGridViewTextBoxColumn();
			this.Column22 = new DataGridViewTextBoxColumn();
			this.groupBox2 = new GroupBox();
			this.label21 = new Label();
			this.cbbNational = new ComboBox();
			this.cbbVAT = new ComboBox();
			this.label20 = new Label();
			this.txtProductPrice2 = new TextBox();
			this.txtProductPrice1 = new TextBox();
			this.label18 = new Label();
			this.dptProductExpiryDate = new DateTimePicker();
			this.label16 = new Label();
			this.dtpProductDate = new DateTimePicker();
			this.label15 = new Label();
			this.txtProductPacket = new TextBox();
			this.label14 = new Label();
			this.txtProductPrice = new TextBox();
			this.label13 = new Label();
			this.txtProductMoney = new TextBox();
			this.label12 = new Label();
			this.txtProductNumber = new TextBox();
			this.label11 = new Label();
			this.txtProductUnit = new TextBox();
			this.label10 = new Label();
			this.txtProductName = new TextBox();
			this.label9 = new Label();
			this.label19 = new Label();
			this.btnClose = new Button();
			this.dgvBill = new DataGridView();
			this.dataGridViewTextBoxColumn1 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn7 = new DataGridViewTextBoxColumn();
			this.Column10 = new DataGridViewTextBoxColumn();
			this.Column11 = new DataGridViewTextBoxColumn();
			this.Column12 = new DataGridViewTextBoxColumn();
			this.Column13 = new DataGridViewTextBoxColumn();
			this.Column14 = new DataGridViewTextBoxColumn();
			this.Column19 = new DataGridViewTextBoxColumn();
			this.Column20 = new DataGridViewTextBoxColumn();
			this.Column21 = new DataGridViewTextBoxColumn();
			this.Column23 = new DataGridViewTextBoxColumn();
			this.dtpSelectMonth = new DateTimePicker();
			this.groupBox4 = new GroupBox();
			this.btnSearch = new Button();
			this.rdbInMonth = new RadioButton();
			this.rdbInDay = new RadioButton();
			this.dtpInDay = new DateTimePicker();
			this.cbbAllProduct = new CheckBox();
			this.cbbAllGroup = new CheckBox();
			this.cbbProduct = new ComboBox();
			this.label22 = new Label();
			this.cbbParentGID = new ComboBox();
			this.label23 = new Label();
			this.groupBox1.SuspendLayout();
			((ISupportInitialize)this.dgvProduct).BeginInit();
			this.groupBox2.SuspendLayout();
			((ISupportInitialize)this.dgvBill).BeginInit();
			this.groupBox4.SuspendLayout();
			base.SuspendLayout();
			this.groupBox1.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.groupBox1.Controls.Add(this.txtNote);
			this.groupBox1.Controls.Add(this.label8);
			this.groupBox1.Controls.Add(this.txtDebt);
			this.groupBox1.Controls.Add(this.label6);
			this.groupBox1.Controls.Add(this.cbbProvider);
			this.groupBox1.Controls.Add(this.label5);
			this.groupBox1.Controls.Add(this.cbbWareHouse);
			this.groupBox1.Controls.Add(this.cbbTypeInput);
			this.groupBox1.Controls.Add(this.label3);
			this.groupBox1.Controls.Add(this.label4);
			this.groupBox1.Controls.Add(this.label2);
			this.groupBox1.Controls.Add(this.txtDate);
			this.groupBox1.Controls.Add(this.txtID);
			this.groupBox1.Controls.Add(this.label1);
			this.groupBox1.Location = new System.Drawing.Point(343, 90);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new Size(600, 114);
			this.groupBox1.TabIndex = 0;
			this.groupBox1.TabStop = false;
			this.groupBox1.Text = "Thông tin đơn hàng";
			this.txtNote.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.txtNote.Location = new System.Drawing.Point(297, 80);
			this.txtNote.Name = "txtNote";
			this.txtNote.Size = new Size(295, 21);
			this.txtNote.TabIndex = 6;
			this.label8.AutoSize = true;
			this.label8.Location = new System.Drawing.Point(232, 83);
			this.label8.Name = "label8";
			this.label8.Size = new Size(62, 15);
			this.label8.TabIndex = 16;
			this.label8.Text = "Diễn giải :";
			this.txtDebt.BackColor = Color.White;
			this.txtDebt.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 0);
			this.txtDebt.ForeColor = Color.FromArgb(0, 0, 192);
			this.txtDebt.Location = new System.Drawing.Point(567, 51);
			this.txtDebt.Name = "txtDebt";
			this.txtDebt.ReadOnly = true;
			this.txtDebt.Size = new Size(85, 21);
			this.txtDebt.TabIndex = 13;
			this.txtDebt.Text = "0";
			this.txtDebt.TextAlign = HorizontalAlignment.Right;
			this.label6.AutoSize = true;
			this.label6.Location = new System.Drawing.Point(502, 54);
			this.label6.Name = "label6";
			this.label6.Size = new Size(61, 15);
			this.label6.TabIndex = 12;
			this.label6.Text = "Công nợ :";
			this.cbbProvider.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.cbbProvider.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbProvider.FormattingEnabled = true;
			this.cbbProvider.Location = new System.Drawing.Point(567, 21);
			this.cbbProvider.Name = "cbbProvider";
			this.cbbProvider.Size = new Size(25, 23);
			this.cbbProvider.TabIndex = 5;
			this.cbbProvider.SelectedIndexChanged += new EventHandler(this.cbbProvider_SelectedIndexChanged);
			this.label5.AutoSize = true;
			this.label5.Location = new System.Drawing.Point(474, 25);
			this.label5.Name = "label5";
			this.label5.Size = new Size(89, 15);
			this.label5.TabIndex = 10;
			this.label5.Text = "Nhà cung cấp :";
			this.cbbWareHouse.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbWareHouse.FormattingEnabled = true;
			this.cbbWareHouse.Location = new System.Drawing.Point(297, 50);
			this.cbbWareHouse.Name = "cbbWareHouse";
			this.cbbWareHouse.Size = new Size(173, 23);
			this.cbbWareHouse.TabIndex = 4;
			this.cbbTypeInput.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbTypeInput.FormattingEnabled = true;
			this.cbbTypeInput.Location = new System.Drawing.Point(297, 21);
			this.cbbTypeInput.Name = "cbbTypeInput";
			this.cbbTypeInput.Size = new Size(173, 23);
			this.cbbTypeInput.TabIndex = 3;
			this.label3.AutoSize = true;
			this.label3.Location = new System.Drawing.Point(228, 54);
			this.label3.Name = "label3";
			this.label3.Size = new Size(66, 15);
			this.label3.TabIndex = 7;
			this.label3.Text = "Kho hàng :";
			this.label4.AutoSize = true;
			this.label4.Location = new System.Drawing.Point(231, 25);
			this.label4.Name = "label4";
			this.label4.Size = new Size(63, 15);
			this.label4.TabIndex = 4;
			this.label4.Text = "Quy cách :";
			this.label2.AutoSize = true;
			this.label2.Location = new System.Drawing.Point(50, 54);
			this.label2.Name = "label2";
			this.label2.Size = new Size(72, 15);
			this.label2.TabIndex = 3;
			this.label2.Text = "Ngày nhập :";
			this.txtDate.CustomFormat = "dd/MM/yyyy";
			this.txtDate.Format = DateTimePickerFormat.Custom;
			this.txtDate.Location = new System.Drawing.Point(125, 51);
			this.txtDate.Name = "txtDate";
			this.txtDate.Size = new Size(100, 21);
			this.txtDate.TabIndex = 2;
			this.txtID.BackColor = Color.White;
			this.txtID.CharacterCasing = CharacterCasing.Upper;
			this.txtID.Location = new System.Drawing.Point(125, 22);
			this.txtID.Name = "txtID";
			this.txtID.ReadOnly = true;
			this.txtID.Size = new Size(100, 21);
			this.txtID.TabIndex = 1;
			this.label1.AutoSize = true;
			this.label1.Location = new System.Drawing.Point(11, 25);
			this.label1.Name = "label1";
			this.label1.Size = new Size(111, 15);
			this.label1.TabIndex = 0;
			this.label1.Text = "Số hiệu đơn hàng :";
			this.txtTotalMoney.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.txtTotalMoney.BackColor = SystemColors.Control;
			this.txtTotalMoney.Font = new Font("Arial", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.txtTotalMoney.ForeColor = Color.Blue;
			this.txtTotalMoney.Location = new System.Drawing.Point(7, 569);
			this.txtTotalMoney.Name = "txtTotalMoney";
			this.txtTotalMoney.ReadOnly = true;
			this.txtTotalMoney.Size = new Size(313, 22);
			this.txtTotalMoney.TabIndex = 15;
			this.txtTotalMoney.Text = "0";
			this.txtTotalMoney.TextAlign = HorizontalAlignment.Right;
			this.dgvProduct.AllowUserToAddRows = false;
			this.dgvProduct.AllowUserToDeleteRows = false;
			this.dgvProduct.AllowUserToResizeColumns = false;
			this.dgvProduct.AllowUserToResizeRows = false;
			dataGridViewCellStyle.BackColor = Color.FromArgb(192, 255, 255);
			dataGridViewCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle;
			this.dgvProduct.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.dgvProduct.BackgroundColor = Color.White;
			this.dgvProduct.BorderStyle = BorderStyle.Fixed3D;
			this.dgvProduct.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
			this.dgvProduct.Columns.AddRange(new DataGridViewColumn[]
			{
				this.Column1,
				this.Column2,
				this.Column3,
				this.Column4,
				this.Column5,
				this.Column6,
				this.Column18,
				this.Column7,
				this.Column8,
				this.Column9,
				this.Column15,
				this.Column16,
				this.Column17,
				this.Column22
			});
			this.dgvProduct.Cursor = Cursors.Hand;
			this.dgvProduct.EnableHeadersVisualStyles = false;
			this.dgvProduct.Location = new System.Drawing.Point(326, 90);
			this.dgvProduct.MultiSelect = false;
			this.dgvProduct.Name = "dgvProduct";
			this.dgvProduct.ReadOnly = true;
			this.dgvProduct.RowHeadersVisible = false;
			this.dgvProduct.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
			dataGridViewCellStyle2.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvProduct.RowsDefaultCellStyle = dataGridViewCellStyle2;
			this.dgvProduct.RowTemplate.DefaultCellStyle.BackColor = Color.White;
			this.dgvProduct.RowTemplate.DefaultCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvProduct.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
			this.dgvProduct.Size = new Size(617, 470);
			this.dgvProduct.TabIndex = 1;
			this.dgvProduct.CellEnter += new DataGridViewCellEventHandler(this.dgvProduct_CellEnter);
			this.Column1.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column1.DataPropertyName = "Packet";
			this.Column1.HeaderText = "Số lô";
			this.Column1.MinimumWidth = 120;
			this.Column1.Name = "Column1";
			this.Column1.ReadOnly = true;
			this.Column1.Width = 120;
			this.Column2.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
			this.Column2.DataPropertyName = "productName";
			this.Column2.HeaderText = "Sản phẩm";
			this.Column2.Name = "Column2";
			this.Column2.ReadOnly = true;
			this.Column3.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column3.DataPropertyName = "productUnit";
			this.Column3.HeaderText = "Đơn vị tính";
			this.Column3.MinimumWidth = 110;
			this.Column3.Name = "Column3";
			this.Column3.ReadOnly = true;
			this.Column3.Width = 110;
			this.Column4.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column4.DataPropertyName = "productNumber";
			dataGridViewCellStyle3.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle3.Format = "N0";
			dataGridViewCellStyle3.NullValue = null;
			this.Column4.DefaultCellStyle = dataGridViewCellStyle3;
			this.Column4.HeaderText = "Số lượng";
			this.Column4.MinimumWidth = 85;
			this.Column4.Name = "Column4";
			this.Column4.ReadOnly = true;
			this.Column4.Width = 85;
			this.Column5.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column5.DataPropertyName = "productPrice";
			dataGridViewCellStyle4.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle4.Format = "N0";
			dataGridViewCellStyle4.NullValue = null;
			this.Column5.DefaultCellStyle = dataGridViewCellStyle4;
			this.Column5.HeaderText = "Đơn giá";
			this.Column5.MinimumWidth = 80;
			this.Column5.Name = "Column5";
			this.Column5.ReadOnly = true;
			this.Column5.Visible = false;
			this.Column5.Width = 80;
			this.Column6.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column6.DataPropertyName = "ProductMoney";
			dataGridViewCellStyle5.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle5.Format = "N0";
			dataGridViewCellStyle5.NullValue = null;
			this.Column6.DefaultCellStyle = dataGridViewCellStyle5;
			this.Column6.HeaderText = "Thành tiền";
			this.Column6.MinimumWidth = 90;
			this.Column6.Name = "Column6";
			this.Column6.ReadOnly = true;
			this.Column6.Visible = false;
			this.Column6.Width = 90;
			this.Column18.DataPropertyName = "VAT";
			dataGridViewCellStyle6.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle6.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle6.ForeColor = Color.Blue;
			this.Column18.DefaultCellStyle = dataGridViewCellStyle6;
			this.Column18.HeaderText = "VAT";
			this.Column18.MinimumWidth = 40;
			this.Column18.Name = "Column18";
			this.Column18.ReadOnly = true;
			this.Column18.Visible = false;
			this.Column18.Width = 40;
			this.Column7.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column7.DataPropertyName = "ProductDate";
			dataGridViewCellStyle7.Format = "dd/MM/yyyy";
			this.Column7.DefaultCellStyle = dataGridViewCellStyle7;
			this.Column7.HeaderText = "Ngày SX";
			this.Column7.MinimumWidth = 80;
			this.Column7.Name = "Column7";
			this.Column7.ReadOnly = true;
			this.Column7.Visible = false;
			this.Column7.Width = 80;
			this.Column8.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column8.DataPropertyName = "ProductExpiryDate";
			dataGridViewCellStyle8.Format = "dd/MM/yyyy";
			this.Column8.DefaultCellStyle = dataGridViewCellStyle8;
			this.Column8.HeaderText = "Hạn dùng";
			this.Column8.MinimumWidth = 90;
			this.Column8.Name = "Column8";
			this.Column8.ReadOnly = true;
			this.Column8.Visible = false;
			this.Column8.Width = 90;
			this.Column9.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column9.DataPropertyName = "Pid";
			this.Column9.HeaderText = "Mã sản phẩm";
			this.Column9.Name = "Column9";
			this.Column9.ReadOnly = true;
			this.Column9.Visible = false;
			this.Column15.DataPropertyName = "ProductPrice1";
			this.Column15.HeaderText = "Giá bán buôn";
			this.Column15.Name = "Column15";
			this.Column15.ReadOnly = true;
			this.Column15.Visible = false;
			this.Column16.DataPropertyName = "ProductPrice2";
			this.Column16.HeaderText = "Giá bán lẻ";
			this.Column16.Name = "Column16";
			this.Column16.ReadOnly = true;
			this.Column16.Visible = false;
			this.Column17.DataPropertyName = "NationalID";
			this.Column17.HeaderText = "Xuất xứ";
			this.Column17.Name = "Column17";
			this.Column17.ReadOnly = true;
			this.Column17.Visible = false;
			this.Column22.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column22.DataPropertyName = "Surplus";
			dataGridViewCellStyle9.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle9.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle9.ForeColor = Color.Blue;
			this.Column22.DefaultCellStyle = dataGridViewCellStyle9;
			this.Column22.HeaderText = "Lợi nhuận";
			this.Column22.MinimumWidth = 120;
			this.Column22.Name = "Column22";
			this.Column22.ReadOnly = true;
			this.Column22.Width = 120;
			this.groupBox2.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.groupBox2.Controls.Add(this.label21);
			this.groupBox2.Controls.Add(this.cbbNational);
			this.groupBox2.Controls.Add(this.cbbVAT);
			this.groupBox2.Controls.Add(this.label20);
			this.groupBox2.Controls.Add(this.txtProductPrice2);
			this.groupBox2.Controls.Add(this.txtProductPrice1);
			this.groupBox2.Controls.Add(this.label18);
			this.groupBox2.Controls.Add(this.dptProductExpiryDate);
			this.groupBox2.Controls.Add(this.label16);
			this.groupBox2.Controls.Add(this.dtpProductDate);
			this.groupBox2.Controls.Add(this.label15);
			this.groupBox2.Controls.Add(this.txtProductPacket);
			this.groupBox2.Controls.Add(this.label14);
			this.groupBox2.Controls.Add(this.txtProductPrice);
			this.groupBox2.Controls.Add(this.label13);
			this.groupBox2.Controls.Add(this.txtProductMoney);
			this.groupBox2.Controls.Add(this.label12);
			this.groupBox2.Controls.Add(this.txtProductNumber);
			this.groupBox2.Controls.Add(this.label11);
			this.groupBox2.Controls.Add(this.txtProductUnit);
			this.groupBox2.Controls.Add(this.label10);
			this.groupBox2.Controls.Add(this.txtProductName);
			this.groupBox2.Controls.Add(this.label9);
			this.groupBox2.Controls.Add(this.label19);
			this.groupBox2.Location = new System.Drawing.Point(343, 200);
			this.groupBox2.Name = "groupBox2";
			this.groupBox2.Size = new Size(600, 142);
			this.groupBox2.TabIndex = 2;
			this.groupBox2.TabStop = false;
			this.groupBox2.Text = "Sản phần cần nhập";
			this.label21.AutoSize = true;
			this.label21.Location = new System.Drawing.Point(45, 110);
			this.label21.Name = "label21";
			this.label21.Size = new Size(53, 15);
			this.label21.TabIndex = 38;
			this.label21.Text = "Xuất xứ :";
			this.cbbNational.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbNational.FormattingEnabled = true;
			this.cbbNational.Items.AddRange(new object[]
			{
				"      0%",
				"      5%",
				"    10%"
			});
			this.cbbNational.Location = new System.Drawing.Point(101, 105);
			this.cbbNational.Name = "cbbNational";
			this.cbbNational.Size = new Size(278, 23);
			this.cbbNational.TabIndex = 37;
			this.cbbVAT.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbVAT.FormattingEnabled = true;
			this.cbbVAT.Items.AddRange(new object[]
			{
				"VAT   :    0%",
				"VAT   :    5%",
				"VAT   :    10%"
			});
			this.cbbVAT.Location = new System.Drawing.Point(602, 19);
			this.cbbVAT.Name = "cbbVAT";
			this.cbbVAT.Size = new Size(100, 23);
			this.cbbVAT.TabIndex = 36;
			this.cbbVAT.SelectedIndexChanged += new EventHandler(this.cbbVAT_SelectedIndexChanged);
			this.label20.AutoSize = true;
			this.label20.Location = new System.Drawing.Point(567, 24);
			this.label20.Name = "label20";
			this.label20.Size = new Size(32, 15);
			this.label20.TabIndex = 35;
			this.label20.Text = "VAT :";
			this.txtProductPrice2.BackColor = Color.White;
			this.txtProductPrice2.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.txtProductPrice2.Location = new System.Drawing.Point(602, 49);
			this.txtProductPrice2.Name = "txtProductPrice2";
			this.txtProductPrice2.ReadOnly = true;
			this.txtProductPrice2.Size = new Size(100, 22);
			this.txtProductPrice2.TabIndex = 33;
			this.txtProductPrice2.TextAlign = HorizontalAlignment.Right;
			this.txtProductPrice1.BackColor = Color.White;
			this.txtProductPrice1.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.txtProductPrice1.Location = new System.Drawing.Point(455, 49);
			this.txtProductPrice1.Name = "txtProductPrice1";
			this.txtProductPrice1.ReadOnly = true;
			this.txtProductPrice1.Size = new Size(100, 22);
			this.txtProductPrice1.TabIndex = 31;
			this.txtProductPrice1.TextAlign = HorizontalAlignment.Right;
			this.label18.AutoSize = true;
			this.label18.Location = new System.Drawing.Point(390, 52);
			this.label18.Name = "label18";
			this.label18.Size = new Size(63, 15);
			this.label18.TabIndex = 32;
			this.label18.Text = "Giá buôn :";
			this.dptProductExpiryDate.CalendarForeColor = Color.Red;
			this.dptProductExpiryDate.CustomFormat = "dd/MM/yyyy";
			this.dptProductExpiryDate.Format = DateTimePickerFormat.Custom;
			this.dptProductExpiryDate.Location = new System.Drawing.Point(602, 77);
			this.dptProductExpiryDate.Name = "dptProductExpiryDate";
			this.dptProductExpiryDate.Size = new Size(100, 21);
			this.dptProductExpiryDate.TabIndex = 14;
			this.label16.AutoSize = true;
			this.label16.ForeColor = Color.Red;
			this.label16.Location = new System.Drawing.Point(560, 80);
			this.label16.Name = "label16";
			this.label16.Size = new Size(39, 15);
			this.label16.TabIndex = 30;
			this.label16.Text = "HSD :";
			this.dtpProductDate.CustomFormat = "dd/MM/yyyy";
			this.dtpProductDate.Format = DateTimePickerFormat.Custom;
			this.dtpProductDate.Location = new System.Drawing.Point(455, 77);
			this.dtpProductDate.Name = "dtpProductDate";
			this.dtpProductDate.Size = new Size(100, 21);
			this.dtpProductDate.TabIndex = 13;
			this.label15.AutoSize = true;
			this.label15.ForeColor = Color.Red;
			this.label15.Location = new System.Drawing.Point(394, 80);
			this.label15.Name = "label15";
			this.label15.Size = new Size(59, 15);
			this.label15.TabIndex = 28;
			this.label15.Text = "Ngày SX :";
			this.txtProductPacket.BackColor = Color.White;
			this.txtProductPacket.CharacterCasing = CharacterCasing.Upper;
			this.txtProductPacket.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.txtProductPacket.Location = new System.Drawing.Point(279, 78);
			this.txtProductPacket.Name = "txtProductPacket";
			this.txtProductPacket.Size = new Size(100, 22);
			this.txtProductPacket.TabIndex = 12;
			this.label14.AutoSize = true;
			this.label14.Location = new System.Drawing.Point(235, 81);
			this.label14.Name = "label14";
			this.label14.Size = new Size(41, 15);
			this.label14.TabIndex = 26;
			this.label14.Text = "Số lô :";
			this.txtProductPrice.BackColor = Color.White;
			this.txtProductPrice.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.txtProductPrice.Location = new System.Drawing.Point(101, 49);
			this.txtProductPrice.Name = "txtProductPrice";
			this.txtProductPrice.Size = new Size(100, 22);
			this.txtProductPrice.TabIndex = 9;
			this.txtProductPrice.TextAlign = HorizontalAlignment.Right;
			this.txtProductPrice.TextChanged += new EventHandler(this.txtProductPrice_TextChanged);
			this.label13.AutoSize = true;
			this.label13.Location = new System.Drawing.Point(35, 52);
			this.label13.Name = "label13";
			this.label13.Size = new Size(63, 15);
			this.label13.TabIndex = 24;
			this.label13.Text = "Giá nhập :";
			this.txtProductMoney.BackColor = Color.White;
			this.txtProductMoney.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.txtProductMoney.Location = new System.Drawing.Point(101, 78);
			this.txtProductMoney.Name = "txtProductMoney";
			this.txtProductMoney.ReadOnly = true;
			this.txtProductMoney.Size = new Size(100, 22);
			this.txtProductMoney.TabIndex = 11;
			this.txtProductMoney.TextAlign = HorizontalAlignment.Right;
			this.txtProductMoney.TextChanged += new EventHandler(this.txtProductMoney_TextChanged);
			this.label12.AutoSize = true;
			this.label12.Location = new System.Drawing.Point(26, 81);
			this.label12.Name = "label12";
			this.label12.Size = new Size(71, 15);
			this.label12.TabIndex = 22;
			this.label12.Text = "Thành tiền :";
			this.txtProductNumber.BackColor = Color.White;
			this.txtProductNumber.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.txtProductNumber.Location = new System.Drawing.Point(279, 49);
			this.txtProductNumber.Name = "txtProductNumber";
			this.txtProductNumber.Size = new Size(100, 22);
			this.txtProductNumber.TabIndex = 10;
			this.txtProductNumber.TextAlign = HorizontalAlignment.Right;
			this.txtProductNumber.TextChanged += new EventHandler(this.txtProductNumber_TextChanged);
			this.txtProductNumber.KeyPress += new KeyPressEventHandler(this.txtProductNumber_KeyPress);
			this.label11.AutoSize = true;
			this.label11.Location = new System.Drawing.Point(212, 52);
			this.label11.Name = "label11";
			this.label11.Size = new Size(64, 15);
			this.label11.TabIndex = 20;
			this.label11.Text = "Số lượng :";
			this.txtProductUnit.BackColor = Color.White;
			this.txtProductUnit.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.txtProductUnit.Location = new System.Drawing.Point(455, 21);
			this.txtProductUnit.Name = "txtProductUnit";
			this.txtProductUnit.ReadOnly = true;
			this.txtProductUnit.Size = new Size(100, 22);
			this.txtProductUnit.TabIndex = 8;
			this.txtProductUnit.TextChanged += new EventHandler(this.txtProductUnit_TextChanged);
			this.label10.AutoSize = true;
			this.label10.Location = new System.Drawing.Point(382, 24);
			this.label10.Name = "label10";
			this.label10.Size = new Size(71, 15);
			this.label10.TabIndex = 18;
			this.label10.Text = "Đơn vị tính :";
			this.txtProductName.BackColor = Color.White;
			this.txtProductName.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.txtProductName.Location = new System.Drawing.Point(101, 21);
			this.txtProductName.Name = "txtProductName";
			this.txtProductName.ReadOnly = true;
			this.txtProductName.Size = new Size(278, 22);
			this.txtProductName.TabIndex = 7;
			this.txtProductName.TextChanged += new EventHandler(this.txtProductName_TextChanged);
			this.label9.AutoSize = true;
			this.label9.Location = new System.Drawing.Point(5, 24);
			this.label9.Name = "label9";
			this.label9.Size = new Size(93, 15);
			this.label9.TabIndex = 16;
			this.label9.Text = "Tên sản phẩm :";
			this.label19.AutoSize = true;
			this.label19.Location = new System.Drawing.Point(554, 52);
			this.label19.Name = "label19";
			this.label19.Size = new Size(45, 15);
			this.label19.TabIndex = 34;
			this.label19.Text = "Giá lẻ :";
			this.btnClose.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
			this.btnClose.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnClose.Location = new System.Drawing.Point(853, 566);
			this.btnClose.Name = "btnClose";
			this.btnClose.Size = new Size(90, 30);
			this.btnClose.TabIndex = 38;
			this.btnClose.Text = "Thoát  [ ESC ]";
			this.btnClose.UseVisualStyleBackColor = true;
			this.btnClose.Click += new EventHandler(this.btnClose_Click);
			this.dgvBill.AllowUserToAddRows = false;
			this.dgvBill.AllowUserToDeleteRows = false;
			this.dgvBill.AllowUserToOrderColumns = true;
			this.dgvBill.AllowUserToResizeColumns = false;
			this.dgvBill.AllowUserToResizeRows = false;
			dataGridViewCellStyle10.BackColor = Color.FromArgb(192, 255, 255);
			dataGridViewCellStyle10.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvBill.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle10;
			this.dgvBill.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left);
			this.dgvBill.BackgroundColor = Color.White;
			this.dgvBill.BorderStyle = BorderStyle.Fixed3D;
			this.dgvBill.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
			this.dgvBill.Columns.AddRange(new DataGridViewColumn[]
			{
				this.dataGridViewTextBoxColumn1,
				this.dataGridViewTextBoxColumn7,
				this.Column10,
				this.Column11,
				this.Column12,
				this.Column13,
				this.Column14,
				this.Column19,
				this.Column20,
				this.Column21,
				this.Column23
			});
			this.dgvBill.Cursor = Cursors.Hand;
			this.dgvBill.EnableHeadersVisualStyles = false;
			this.dgvBill.Location = new System.Drawing.Point(7, 90);
			this.dgvBill.MultiSelect = false;
			this.dgvBill.Name = "dgvBill";
			this.dgvBill.ReadOnly = true;
			this.dgvBill.RowHeadersVisible = false;
			this.dgvBill.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
			this.dgvBill.RowTemplate.DefaultCellStyle.BackColor = Color.White;
			this.dgvBill.RowTemplate.DefaultCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvBill.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
			this.dgvBill.Size = new Size(313, 470);
			this.dgvBill.TabIndex = 39;
			this.dgvBill.CellEnter += new DataGridViewCellEventHandler(this.dgvBill_CellEnter);
			this.dataGridViewTextBoxColumn1.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
			this.dataGridViewTextBoxColumn1.DataPropertyName = "ID";
			this.dataGridViewTextBoxColumn1.HeaderText = "Hoá đơn";
			this.dataGridViewTextBoxColumn1.MinimumWidth = 120;
			this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
			this.dataGridViewTextBoxColumn1.ReadOnly = true;
			this.dataGridViewTextBoxColumn7.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn7.DataPropertyName = "CreateDate";
			dataGridViewCellStyle11.Format = "D";
			dataGridViewCellStyle11.NullValue = null;
			this.dataGridViewTextBoxColumn7.DefaultCellStyle = dataGridViewCellStyle11;
			this.dataGridViewTextBoxColumn7.HeaderText = "Ngày lập";
			this.dataGridViewTextBoxColumn7.MinimumWidth = 82;
			this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
			this.dataGridViewTextBoxColumn7.ReadOnly = true;
			this.dataGridViewTextBoxColumn7.Width = 82;
			this.Column10.DataPropertyName = "TotalMoney";
			dataGridViewCellStyle12.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle12.Format = "N0";
			dataGridViewCellStyle12.NullValue = null;
			this.Column10.DefaultCellStyle = dataGridViewCellStyle12;
			this.Column10.HeaderText = "TotalMoney";
			this.Column10.Name = "Column10";
			this.Column10.ReadOnly = true;
			this.Column10.Visible = false;
			this.Column11.DataPropertyName = "TypeInput";
			this.Column11.HeaderText = "TypeInput";
			this.Column11.Name = "Column11";
			this.Column11.ReadOnly = true;
			this.Column11.Visible = false;
			this.Column12.DataPropertyName = "WID";
			this.Column12.HeaderText = "WID";
			this.Column12.Name = "Column12";
			this.Column12.ReadOnly = true;
			this.Column12.Visible = false;
			this.Column13.DataPropertyName = "Note";
			this.Column13.HeaderText = "Note";
			this.Column13.Name = "Column13";
			this.Column13.ReadOnly = true;
			this.Column13.Visible = false;
			this.Column14.DataPropertyName = "PID";
			this.Column14.HeaderText = "PID";
			this.Column14.Name = "Column14";
			this.Column14.ReadOnly = true;
			this.Column14.Visible = false;
			this.Column19.DataPropertyName = "UserName";
			this.Column19.HeaderText = "Tài khoản";
			this.Column19.Name = "Column19";
			this.Column19.ReadOnly = true;
			this.Column19.Visible = false;
			this.Column20.DataPropertyName = "FullName";
			this.Column20.HeaderText = "Tên tài khoản";
			this.Column20.Name = "Column20";
			this.Column20.ReadOnly = true;
			this.Column20.Visible = false;
			this.Column21.DataPropertyName = "Printed";
			this.Column21.HeaderText = "Printed";
			this.Column21.Name = "Column21";
			this.Column21.ReadOnly = true;
			this.Column21.Visible = false;
			this.Column23.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column23.DataPropertyName = "Surplus";
			dataGridViewCellStyle13.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle13.Font = new Font("Arial", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0);
			dataGridViewCellStyle13.ForeColor = Color.Blue;
			dataGridViewCellStyle13.Format = "N0";
			dataGridViewCellStyle13.NullValue = null;
			this.Column23.DefaultCellStyle = dataGridViewCellStyle13;
			this.Column23.HeaderText = "Lợi nhuận";
			this.Column23.MinimumWidth = 90;
			this.Column23.Name = "Column23";
			this.Column23.ReadOnly = true;
			this.Column23.Width = 90;
			this.dtpSelectMonth.CustomFormat = "MM/yyyy";
			this.dtpSelectMonth.Font = new Font("Arial", 9f);
			this.dtpSelectMonth.Format = DateTimePickerFormat.Custom;
			this.dtpSelectMonth.Location = new System.Drawing.Point(149, 42);
			this.dtpSelectMonth.Name = "dtpSelectMonth";
			this.dtpSelectMonth.Size = new Size(80, 21);
			this.dtpSelectMonth.TabIndex = 29;
			this.dtpSelectMonth.ValueChanged += new EventHandler(this.dtpSelectMonth_ValueChanged);
			this.groupBox4.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.groupBox4.Controls.Add(this.btnSearch);
			this.groupBox4.Controls.Add(this.rdbInMonth);
			this.groupBox4.Controls.Add(this.rdbInDay);
			this.groupBox4.Controls.Add(this.dtpInDay);
			this.groupBox4.Controls.Add(this.dtpSelectMonth);
			this.groupBox4.Controls.Add(this.cbbAllProduct);
			this.groupBox4.Controls.Add(this.cbbAllGroup);
			this.groupBox4.Controls.Add(this.cbbProduct);
			this.groupBox4.Controls.Add(this.label22);
			this.groupBox4.Controls.Add(this.cbbParentGID);
			this.groupBox4.Controls.Add(this.label23);
			this.groupBox4.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.groupBox4.Location = new System.Drawing.Point(7, 2);
			this.groupBox4.Name = "groupBox4";
			this.groupBox4.Size = new Size(936, 82);
			this.groupBox4.TabIndex = 41;
			this.groupBox4.TabStop = false;
			this.groupBox4.Text = "Điều kiện tìm kiếm";
			this.btnSearch.Anchor = (AnchorStyles.Top | AnchorStyles.Right);
			this.btnSearch.FlatAppearance.BorderColor = Color.FromArgb(128, 128, 255);
			this.btnSearch.FlatStyle = FlatStyle.Flat;
			this.btnSearch.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnSearch.Location = new System.Drawing.Point(822, 48);
			this.btnSearch.Name = "btnSearch";
			this.btnSearch.Size = new Size(100, 28);
			this.btnSearch.TabIndex = 42;
			this.btnSearch.Text = "Xem lợi nhuận";
			this.btnSearch.UseVisualStyleBackColor = true;
			this.btnSearch.Click += new EventHandler(this.btnSearch_Click);
			this.rdbInMonth.AutoSize = true;
			this.rdbInMonth.Font = new Font("Arial", 9f);
			this.rdbInMonth.Location = new System.Drawing.Point(49, 44);
			this.rdbInMonth.Name = "rdbInMonth";
			this.rdbInMonth.Size = new Size(97, 19);
			this.rdbInMonth.TabIndex = 47;
			this.rdbInMonth.Text = "Trong tháng :";
			this.rdbInMonth.UseVisualStyleBackColor = true;
			this.rdbInDay.AutoSize = true;
			this.rdbInDay.Checked = true;
			this.rdbInDay.Font = new Font("Arial", 9f);
			this.rdbInDay.Location = new System.Drawing.Point(49, 16);
			this.rdbInDay.Name = "rdbInDay";
			this.rdbInDay.Size = new Size(92, 19);
			this.rdbInDay.TabIndex = 46;
			this.rdbInDay.TabStop = true;
			this.rdbInDay.Text = "Trong ngày :";
			this.rdbInDay.UseVisualStyleBackColor = true;
			this.dtpInDay.CustomFormat = "dd/MM/yyyy";
			this.dtpInDay.Font = new Font("Arial", 9f);
			this.dtpInDay.Format = DateTimePickerFormat.Custom;
			this.dtpInDay.Location = new System.Drawing.Point(149, 16);
			this.dtpInDay.Name = "dtpInDay";
			this.dtpInDay.Size = new Size(80, 21);
			this.dtpInDay.TabIndex = 45;
			this.cbbAllProduct.AutoSize = true;
			this.cbbAllProduct.Font = new Font("Arial", 9f);
			this.cbbAllProduct.Location = new System.Drawing.Point(646, 46);
			this.cbbAllProduct.Name = "cbbAllProduct";
			this.cbbAllProduct.Size = new Size(83, 19);
			this.cbbAllProduct.TabIndex = 44;
			this.cbbAllProduct.Text = "Xem tất cả";
			this.cbbAllProduct.UseVisualStyleBackColor = true;
			this.cbbAllProduct.CheckedChanged += new EventHandler(this.cbbAllProduct_CheckedChanged);
			this.cbbAllGroup.AutoSize = true;
			this.cbbAllGroup.Checked = true;
			this.cbbAllGroup.CheckState = CheckState.Checked;
			this.cbbAllGroup.Font = new Font("Arial", 9f);
			this.cbbAllGroup.Location = new System.Drawing.Point(319, 46);
			this.cbbAllGroup.Name = "cbbAllGroup";
			this.cbbAllGroup.Size = new Size(83, 19);
			this.cbbAllGroup.TabIndex = 40;
			this.cbbAllGroup.Text = "Xem tất cả";
			this.cbbAllGroup.UseVisualStyleBackColor = true;
			this.cbbAllGroup.CheckedChanged += new EventHandler(this.cbbAllGroup_CheckedChanged);
			this.cbbProduct.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.cbbProduct.BackColor = Color.White;
			this.cbbProduct.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbProduct.FlatStyle = FlatStyle.Flat;
			this.cbbProduct.Font = new Font("Arial", 9f);
			this.cbbProduct.FormattingEnabled = true;
			this.cbbProduct.Location = new System.Drawing.Point(646, 17);
			this.cbbProduct.Name = "cbbProduct";
			this.cbbProduct.Size = new Size(276, 23);
			this.cbbProduct.TabIndex = 42;
			this.cbbProduct.SelectedIndexChanged += new EventHandler(this.cbbProduct_SelectedIndexChanged);
			this.label22.AutoSize = true;
			this.label22.Font = new Font("Arial", 9f);
			this.label22.Location = new System.Drawing.Point(575, 21);
			this.label22.Name = "label22";
			this.label22.Size = new Size(67, 15);
			this.label22.TabIndex = 43;
			this.label22.Text = "Tên thuốc :";
			this.cbbParentGID.BackColor = Color.White;
			this.cbbParentGID.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbParentGID.FlatStyle = FlatStyle.Flat;
			this.cbbParentGID.Font = new Font("Arial", 9f);
			this.cbbParentGID.FormattingEnabled = true;
			this.cbbParentGID.Location = new System.Drawing.Point(319, 17);
			this.cbbParentGID.Name = "cbbParentGID";
			this.cbbParentGID.Size = new Size(250, 23);
			this.cbbParentGID.TabIndex = 40;
			this.cbbParentGID.SelectedIndexChanged += new EventHandler(this.cbbParentGID_SelectedIndexChanged);
			this.label23.AutoSize = true;
			this.label23.Font = new Font("Arial", 9f);
			this.label23.Location = new System.Drawing.Point(245, 21);
			this.label23.Name = "label23";
			this.label23.Size = new Size(70, 15);
			this.label23.TabIndex = 41;
			this.label23.Text = "Loại thuốc :";
			base.AutoScaleDimensions = new SizeF(7f, 15f);
			//base.AutoScaleMode = AutoScaleMode.Font;
			base.ClientSize = new Size(950, 600);
			base.Controls.Add(this.groupBox4);
			base.Controls.Add(this.dgvProduct);
			base.Controls.Add(this.txtTotalMoney);
			base.Controls.Add(this.dgvBill);
			base.Controls.Add(this.btnClose);
			base.Controls.Add(this.groupBox2);
			base.Controls.Add(this.groupBox1);
			this.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			//base.Icon = (System.Drawing.Icon)componentResourceManager.GetObject("$this.Icon");
			//base.Icon = (Icon)componentResourceManager.GetObject("$this.Icon");
			base.KeyPreview = true;
			base.Name = "frmSurplus";
			base.ShowInTaskbar = false;
			base.StartPosition = FormStartPosition.CenterScreen;
			this.Text = "LỢI NHUẬN BÁN HÀNG";
			base.WindowState = FormWindowState.Maximized;
			base.Load += new EventHandler(this.frmInput_Load);
			base.KeyDown += new KeyEventHandler(this.frmInput_KeyDown);
			this.groupBox1.ResumeLayout(false);
			this.groupBox1.PerformLayout();
			((ISupportInitialize)this.dgvProduct).EndInit();
			this.groupBox2.ResumeLayout(false);
			this.groupBox2.PerformLayout();
			((ISupportInitialize)this.dgvBill).EndInit();
			this.groupBox4.ResumeLayout(false);
			this.groupBox4.PerformLayout();
			base.ResumeLayout(false);
			base.PerformLayout();
		}
	}
}
